package com.atguigu.ggkt.vod.utils;

import com.atguigu.ggkt.utils.LogTool;
import com.atguigu.ggkt.utils.SpringTool;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

@Component
public class ConstantPropertiesUtil implements InitializingBean{

//    @Value("${tencent.cos.file.region}")
//    private String region;
//
//    @Value("${tencent.cos.file.secretid}")
//    private String secretId;
//
//    @Value("${tencent.cos.file.secretkey}")
//    private String secretKey;
//
//    @Value("${tencent.cos.file.bucketname}")
//    private String bucketName;

    public static String REGION;
    public static String SECRET_ID;
    public static String SECRET_KEY;
    public static String BUCKET_NAME;

    @Override
    public void afterPropertiesSet() {
        REGION = (String) SpringTool.getProperty("tencent.cos.file.region");
        SECRET_ID = (String) SpringTool.getProperty( "tencent.cos.file.secretid");
        SECRET_KEY = (String) SpringTool.getProperty("tencent.cos.file.secretkey");
        BUCKET_NAME = (String) SpringTool.getProperty("tencent.cos.file.bucketname");
        LogTool.info(this.getClass(), "==> REGION: "+REGION);
        LogTool.info(this.getClass(), "==> SECRET_ID: "+SECRET_ID);
        LogTool.info(this.getClass(), "==> BUCKET_NAME: "+BUCKET_NAME);
    }
}
